-
Couldn't load subscription status.
- Fork 16
Async/Sync Tests Rewrite #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Start working on ClientHybrid class. Denotes a type of client that calls both the sync and async versions of a client's fetch_x methods. This is so that, when testing, you don't need two tests for each client type. The guarantee is that the return types between the two clients are the same, so the subsequent tests must also be valid for both of them. This is backed up by a `HybridMethodProxy` class which basically acts as the actual caller returned by the ClientHyrbid to do some validation.
…_fetch_shop to use correct test functions
…tions for known types.
…alidation functions. Kept them as `_` to denote how they are not exported.
…his for every API call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me. Addionally we might want to link the Tests README within the normal README. Also the Changelog note needs to be added, since it got lost during re-creating the PR.
Async/Sync Tests Rewrite
Currently, the tests for both the async and sync clients have separate files, and thus, have a lot of repeated code.
I aim to merge this into one, ensuring that both clients are functioning as expected and strengthening the safety of all available tests.
Overall Idea
I'm planning to create some sort of mock Client/SyncClient hybrid that calls methods from both clients at once when requested. Pytest tests do not run in parallel, so although this is not the best solution it will ensure the following:
This will effectively merge the two independent test files into one, allowing for easier maintainability and readability.
This PR stems from the ongoing #29 PR to migrate all new features to this new test system.
Misc Changes
abc.ReconstructAbleto fix changes withfrom_dictclassmethod typing annotations.attribute_table.py,examples/discord_integration.py,abc.py,aes.py,asset.py,banner.py,client.py,cosmetics/*.py,cosmetics/variants/*.py,errors.py,http.py,images.py,map.py,new.py,new_display_asset.py,news.py,playlist.py,proxies.py,shop.py, andstats.py.synchronizeworkflow trigger in thepull_requestcategory. This caused tests to run twice in an active PR. Now, tests run when pushed to a branch, when a PR is opened, or when a PR is reopened.